﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Simple.EF;
using Simple.Common.EasyUICommon;
using System.Web.Mvc;
using Simple.Entity;
using Simple.Common.Pager;
using Simple.Common.Infrastructure.DependencyManagement;

namespace Simple.Service
{
    //public abstract class ApplicationService : ITransientDependency
    public abstract class ApplicationService 
    {
        protected SimpleResult GetResult(int ret, string message = null)
        {
            if (ret >= 0)
            {
                return GetRight(message ?? "操作成功");
            }
            else
            {
                return GetError(message ?? "操作失败");
            }
        }

        protected SimpleResult GetRight(string message = "操作成功")
        {
            return SimpleResult.GetRight(message);
        }

        protected SimpleResult GetError(string message = "操作失败")
        {
            return SimpleResult.GetError(message);
        }
    }
}
